﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="SpeechSampleWPF.MainWindow"
        Title="Spracherkennung" Height="400" Width="600">
	<Window.Resources>
		<ControlTemplate x:Key="ButtonControlTemplate1" TargetType="{x:Type Button}">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="0.496*"/>
					<RowDefinition Height="0.504*"/>
				</Grid.RowDefinitions>
				<VisualStateManager.VisualStateGroups>
					<VisualStateGroup x:Name="CommonStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="0:0:0.3"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="Normal"/>
						<VisualState x:Name="MouseOver">
							<Storyboard>
								<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="ellipse">
									<EasingColorKeyFrame KeyTime="0" Value="#FFFFEA00"/>
								</ColorAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Pressed">
							<Storyboard>
								<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="ellipse">
									<EasingColorKeyFrame KeyTime="0" Value="#FFA30000"/>
								</ColorAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Disabled"/>
					</VisualStateGroup>
				</VisualStateManager.VisualStateGroups>
				<Ellipse Fill="#FFF4F4F5" Stroke="Black" StrokeThickness="2" Grid.RowSpan="2"/>
				<Ellipse Fill="#FFF4F4F5" StrokeThickness="2" Margin="2" Grid.RowSpan="2">
					<Ellipse.Stroke>
						<LinearGradientBrush EndPoint="0.854,0.854" StartPoint="0.146,0.146">
							<GradientStop Color="Black" Offset="0"/>
							<GradientStop Color="White" Offset="1"/>
						</LinearGradientBrush>
					</Ellipse.Stroke>
				</Ellipse>
				<Ellipse x:Name="ellipse" StrokeThickness="2" Margin="4" Grid.RowSpan="2">
					<Ellipse.Fill>
						<RadialGradientBrush>
							<GradientStop Color="White" Offset="0"/>
							<GradientStop Color="Red" Offset="1"/>
						</RadialGradientBrush>
					</Ellipse.Fill>
				</Ellipse>
				<Path Data="M92,46 C92,71.405098 71.318092,45.421624 45.912993,45.421624 20.507895,45.421624 0,71.405098 0,46 0,20.594902 20.594902,0 46,0 71.405098,0 92,20.594902 92,46 z" Margin="4,4,4,-11.543" Stretch="Fill" StrokeThickness="2" >
					<Path.Fill>
						<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
							<GradientStop Color="White" Offset="0"/>
							<GradientStop Offset="1"/>
						</LinearGradientBrush>
					</Path.Fill>
				</Path>
				<ContentPresenter Grid.RowSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
			</Grid>
		</ControlTemplate>
	</Window.Resources>
    <Grid>
    	<Grid.Background>
    		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    			<GradientStop Color="Black" Offset="0"/>
    			<GradientStop Color="#FF2B2B2B" Offset="0.904"/>
    			<GradientStop Color="Black" Offset="1"/>
    		</LinearGradientBrush>
    	</Grid.Background>
		<TextBox
			x:Name="_text" 
			Text="Good Morning Oliver!" VerticalAlignment="Top" Height="84" FontSize="26.667" Margin="8,8,104,0"/>
		<Button
			Content="Sprechen" 
			x:Name="_speak"
			Click="_speak_Click" Margin="0" VerticalAlignment="Top" Template="{DynamicResource ButtonControlTemplate1}" Width="100" Height="100" HorizontalAlignment="Right" />
		<StackPanel Margin="0" Orientation="Horizontal" HorizontalAlignment="Center" d:LayoutOverrides="Height" VerticalAlignment="Bottom">
			<Button x:Name="_startListen" Content="Start" Height="100" Width="100" Template="{DynamicResource ButtonControlTemplate1}"
				Click="_startListen_Click" Margin="10,0" />
			<Button x:Name="_stopListen" Content="Stop" Height="100" Width="100" Template="{DynamicResource ButtonControlTemplate1}"
				Click="_stopListen_Click" Margin="10,0" />
		</StackPanel>
		<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="Sprache erkennen" VerticalAlignment="Bottom" Foreground="White" Margin="0,0,0,108"/>
		<TextBlock x:Name="_recognizedText" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Center" Foreground="White" Margin="0" FontSize="48"/>
		<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom">
			<TextBlock TextWrapping="Wrap" Text="Bekannte Wörter" FontWeight="Bold" Foreground="White" HorizontalAlignment="Right"/>
			<TextBlock TextWrapping="Wrap" Text="Rechts" Foreground="White" HorizontalAlignment="Right"/>
			<TextBlock TextWrapping="Wrap" Text="Links" Foreground="White" HorizontalAlignment="Right"/>
			<TextBlock TextWrapping="Wrap" Text="Hoch" Foreground="White" HorizontalAlignment="Right"/>
			<TextBlock TextWrapping="Wrap" Text="Runter" Foreground="White" HorizontalAlignment="Right"/>
		</StackPanel>
	</Grid>
</Window>
